package model;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
 * This class implements Human Player configuration.
 *
 */
public class HumanPlayer implements Player
{
    private String name;

    public HumanPlayer(String name)
    {
        super();
        this.name = name;
    }

    @Override
    public String getNextMove(ArrayList<ArrayList<GamePiece>> grid, GamePiece playerPiece)
    {
        System.out.println(this.name + " player's turn :: ");
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String intersectionB = null;
        try
        {
            intersectionB = br.readLine();
        }
        catch (IOException e)
        {
            System.out.println("IO error!");
            System.exit(1);
        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return intersectionB.trim();
    }

    @Override
    public String getName()
    {
        return this.name;
    }

    @Override
    public void OnOpponentPlayedMove(String move){}

}
